<?php
    if(is_array($result))
	{
		header('Content-Type: application/json; Charset=UTF-8',true);
		$jsonData = array('page'=>$stockFN->page,'total'=>$stockFN->numeroRegistros,'rows'=>array());
		foreach ($result as $key => $obj)
		{
			$entry = array('id'=>$obj->getAlmId(),
			    'cell'=>array(
			    
			            'almacenId' =>$obj->getAlmId(),
			            'articuloId'=>utf8_encode($obj->getArtId()),
                                    'almacenNombre'=>utf8_encode($obj->getAlmacenDescripcion()),
                                    'articuloNombre'=>utf8_encode($obj->getItemDescripcion()),
			            'stock'=>utf8_encode($obj->getCantFisico()),
			            'reserva'=>utf8_encode($obj->getCantReserva()),
			            'costoProm'=>utf8_encode($obj->getCostoProm()),
						'costoUlt'=>utf8_encode($obj->getCostoUlt()),			            			            
			            'opciones'=>"<img border='0' title='Detalle Item' src='/gourmet-express/trunk/imgs/icons/application_view_list.png' onclick=fn_detalle('". $obj->getAlmId()."','".$obj->getArtId()."') style='cursor:pointer;'>"
			    ),
			);
			$jsonData['rows'][] = $entry;
		}
		echo json_encode($jsonData);
	}?>